#!/bin/bash

if [ "$1" == "" ]; then
 echo Command line argumnents: piversion [timestamp]
 exit 1
fi 

if [ "$2" == "" ]; then
 TS=`date +%Y%m%d`
else
 TS=$2
fi

cd `dirname $0`
clear
echo Buildung for Raspberry Pi $1
echo ============================
echo
date > buildtime.$1
./build-config $1 
./clean $1
./compile $1
# For some reason, first build sometimes fails
./compile $1
#./create-image $1 $TS
date >> buildtime.$1
